<?php
header("Content-type:text/html; charset=utf-8;");
require '../../../ppf/fun.php';
require '../../../ppf/pdo_mysql.php';
require '../../../ppf/Filter.php';
date_default_timezone_set("PRC");
$pd=new pdo_mysql();
$filter=new Filter();
session_start();
if(empty($_SESSION['uid'])){
	echo '请登录后再进行操作';exit;
}
$submitMethod=$_SERVER["REQUEST_METHOD"];
if($submitMethod=='POST'){
	$id = empty($_POST['id'])?0:Filter::filter_number($_POST['id']);
	$repair_user = Filter::safe_string($_POST['repair_user']);
	$in_data=array(
		'takes_user'=>$repair_user,
		'status'=>1
	);
	//print_r($in_data);exit;
	$result=0;
	$tps='';
	
	if($id==0){
		$result=$pd->insert(array('data'=>$in_data,'table'=>'sys_takes_list'));
	}else{
		$result=$pd->update(array('data'=>$in_data,'table'=>'sys_takes_list','where'=>"id=".$id));
	}
	
	if(empty($result)){
		$tps='操作失败,请重试';
	}else{
		$tps='操作成功';
	}

	echo $tps;exit;
}else{
	echo "不允许的表单提交方式，请按正常流程提交表单。";exit;
}
?>